define(function (require, exports, module) {
        exports.init = function (element, cb) {
                var basic=require('basic');
                var jsonAPI = require('json-api');

                $("#title").text('绑定车辆');
                defineModule({
                        bind:function()
                        {
                                var licenseplate = $("#txtCard").val().trim();
                                if (licenseplate.length != 6) {
                                        $spa.showErrorMsg('请输入有效的车牌号码!');
                                        $("#txtCard").focus();
                                        return;
                                }
                                var mobile=basic.getLoginUser();
                                var param={
                                        mobile:mobile,
                                        licenseplate:$("#ProvinceShort").val()+licenseplate
                                }
                                jsonAPI.restful('/api/vehicle/add', param, function (err, result) {
                                        if (jsonAPI.handleErrors(err, result)) {
                                                $spa.showOk('车辆绑定成功!');
                                                setTimeout(function () {
                                                        $spa.hideOk();
                                                        window.hashTo("#vehicle");
                                                }, 1000);
                                        }
                                });
                        }
                })

                        cb && cb();
        };
});